class Dog{

 public String colour;    public String name;
    public int age;


    public Dog(){
        System.out.println("应用了构造方法");
    }
    public void func(int a, String n, String c){
        age = a;
        name = n;
        colour = c;

    }
    public void bark(){
        System.out.println("汪汪");
    }
    public void wag(){
        System.out.println("摇尾巴");
    }
}
public class Main{
    public static void main(String[] args) {
        Dog dog1 = new Dog();
        dog1.colour = "黄色";
        dog1.age = 19;
        dog1.wag();
        System.out.println("年龄：" + dog1.age);
        Dog dog2 = new Dog();
        dog2.colour = "黑色";
        dog2.age = 20;
        dog2.bark();
    }
}